Skip to content

feat(auth): add SATP agent trust verification provider#171

Open
0xbrainkid wants to merge 2 commits intoQuantGeekDev:mainfrom
0xbrainkid:feat/satp-agent-trust
Open

feat(auth): add SATP agent trust verification provider#171
0xbrainkid wants to merge 2 commits intoQuantGeekDev:mainfrom
0xbrainkid:feat/satp-agent-trust

Conversation

@0xbrainkid
Copy link
Copy Markdown

Summary

Adds SATPProvider as a new auth provider that verifies agent identity and behavioral trust scores via AgentFolio/SATP (Solana Agent Trust Protocol).

Resolves #142

What it does

  • Trust score verification — configurable minimum threshold (0-100)
  • On-chain verification check — optionally require agents to be verified on Solana
  • Agent ID extraction — from x-agent-id header or Authorization: Agent <id>
  • Response caching — configurable TTL (default 5 min) to avoid per-request API calls
  • Graceful degradationonMissing: 'allow' (default) annotates requests without blocking; 'reject' enforces identity

Usage

import { MCPServer, SATPProvider } from 'mcp-framework';

const server = new MCPServer({
  auth: {
    provider: new SATPProvider({
      minTrustScore: 50,      // Require minimum trust score
      requireVerified: true,  // Require on-chain verification
      onMissing: 'allow',     // Don't break unidentified agents
      cacheTtlMs: 300_000,    // 5 minute cache
    }),
  },
});

Design decisions

  1. Follows existing AuthProvider pattern — drop-in compatible, no breaking changes
  2. Opt-in by defaultonMissing: 'allow' means existing servers aren't affected
  3. Minimal scope — just the provider + types, no new dependencies (uses native fetch)
  4. Composable — can be used alongside JWT/OAuth/API key providers

No new dependencies

Uses native fetch (Node 18+). Zero additional packages.

Adds SATPProvider as a new auth provider that verifies agent identity
and behavioral trust scores via AgentFolio/SATP (Solana Agent Trust Protocol).

Features:
- Trust score verification with configurable minimum threshold
- On-chain verification status check
- Agent ID extraction from headers or Authorization bearer
- Response caching with configurable TTL (default 5 min)
- Graceful degradation (allow/reject on missing identity)
- Composable with existing auth providers

Resolves QuantGeekDev#142
@QuantGeekDev
Copy link
Copy Markdown
Owner

@0xbrainkid This looks pretty good, and elegant. Thank you. If you don't mind - what's the best way for me to use this to replicate your results? I can add a docs section on this, or perhaps you could create a quickstart with what external services I need? Docs are in Fumadocs format in this repo - if you add it to the docs, the MCP-Framework MCP server will be able to integrate it automatically https://github.com/QuantGeekDev/mcp-framework-docs

@0xbrainkid
Copy link
Copy Markdown
Author

@QuantGeekDev — glad it fits well! Here's the quickstart:

Quickstart

1. No external services needed for basic usage. The provider queries the AgentFolio public API (api.agentfolio.bot), which is free and requires no API key.

2. Minimal test setup:

import { SATPProvider } from "mcp-framework";

// Allow all agents, just annotate requests with trust data
const provider = new SATPProvider({ onMissing: "allow" });

// Or enforce minimum trust score
const strictProvider = new SATPProvider({
  minTrustScore: 50,
  requireVerified: true,
  onMissing: "reject",
});

3. Testing with a real agent:

Send a request with the header x-agent-id: brainGrowth — that's a verified agent on AgentFolio with a trust score of 335. The provider will return the trust data in AuthResult.data.agentTrust.

4. Testing without an agent:

With onMissing: "allow" (default), requests without x-agent-id pass through normally with agentTrust: null. Existing servers aren't affected.

Docs

Happy to add a docs page in Fumadocs format. I'll push a follow-up commit to this PR with:

  • docs/auth/satp.mdx — quickstart + configuration reference + examples
  • Brief mention in the auth overview page

Give me a few hours and I'll have the docs commit ready.

Adds quickstart, configuration reference, usage modes
(annotation/enforcement/graduated), testing examples, and
composition patterns for the SATPProvider.
@QuantGeekDev
Copy link
Copy Markdown
Owner

that is quite neat. are there any rate limits that should be enforced for this on client code?

@0xbrainkid
Copy link
Copy Markdown
Author

@QuantGeekDev — good question. The AgentFolio API has a generous free tier (no key needed) with soft rate limits:

  • 100 requests/minute per IP (plenty for most servers)
  • The built-in cache (cacheTtlMs: 300000 default = 5 min) means repeated requests for the same agent hit cache, not the API
  • In practice: a server with 10 unique agents calling tools gets ~10 API calls every 5 minutes, well within limits

For high-throughput deployments, two options:

  1. Increase cacheTtlMs (e.g., 900000 = 15 min cache) — trust scores change slowly, longer cache is fine
  2. The provider handles API failures gracefully — if the API is unreachable or returns an error, it falls back to null (no trust data) rather than blocking the request

No client-side rate limiting needed in the provider code — the cache handles it naturally. Should I add a note about this in the docs?

@QuantGeekDev
Copy link
Copy Markdown
Owner

This is great. Merging and will add to next release. Thank you for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Built-in Agent Identity Verification (SATP Integration)

2 participants